import React from 'react'
import Child from './Child'
import {Button} from 'antd'
// import 'antd/dist/antd.css'
import './child.less'
export default class Life extends React.Component{
  constructor (props) {
    super(props)
    this.state = {
      count: 0
    }
  }
  render(){
    return (
      <div className='contain'>
        <p>Reack生命周期</p>
        <Button onClick={this.handleAdd}>点击一下</Button>
        <p>{this.state.count}</p>
        <Child name={this.state.count}></Child>
      </div>
    )
  }
  handleAdd = () => {
    this.setState({
      count: this.state.count + 1
    })
  }
}